package com.zw.mizhe.view.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;

import com.github.paolorotolo.appintro.AppIntro2;
import com.zw.mizhe.R;
import com.zw.mizhe.view.fragment.GuideFragment;

public class GuideActivity extends AppIntro2 {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        addSlide(GuideFragment.newInstance(R.mipmap.guide1));
        addSlide(GuideFragment.newInstance(R.mipmap.guide2));
        addSlide(GuideFragment.newInstance(R.mipmap.guide3));
        addSlide(GuideFragment.newInstance(R.mipmap.guide4));

    }

    @Override
    public void onSkipPressed(Fragment currentFragment) {
        super.onSkipPressed(currentFragment);
        loadMainActivity();
    }

    @Override
    public void onDonePressed(Fragment currentFragment) {
        super.onDonePressed(currentFragment);
        loadMainActivity();
    }

    private void loadMainActivity() {
        Intent intent = new Intent(this, MainActivity.class);
        startActivity(intent);
    }

}
